<extend name='Index:index'/>
<block name='right'>
<div class="rightBody">
<div id="map">
	<span class='title'>添加商品</span>
</div>
<div id="content">
	<form  class='registerform' action="<{:U('Goods/add_handle')}>" method="post" enctype="multipart/form-data"><!-- <{:U('Goods/add_handle')}> -->
	<table class='table table-striped table-bordered'>
		<thead>
			<tr>
				<th >名称</th>
				<th >值</th>
			</tr>
		</thead>
		<tbody>
			<if condition="$shoprow eq true" ><!-- 如果是从商铺管理-添加商品过来的直接显示相应的商铺名称，分类，地区，如果是商品管理-添加商品择自己选择 -->

				<tr>
					<td>商铺名称</td>

					<td>
							<input type="hidden" name='shopid' value="<{$shoprow['shopid']}>">
							<{$shoprow['shopname']}>
					</td>
				</tr>

			<else/>
				<tr>
					<td>商铺名称</td>
					<td>

							<select name="shopid" id="">
							<option value="0">请选择商铺</option>
							<volist name='shoprows' id='shoprow'>
								<option value="<{$shoprow['shopid']}>"><{$shoprow['shopname']}></option>
							</volist>
							</select>
						
					</td>
				</tr>
			</if>
			
				<tr>
					<td>分类名称</td>
					<td>
						<select name="cid" id="">
								<option value="0">请选择分类</option>
								<volist name='caterows' id='caterow'>
									<option value="<{$caterow['cid']}>">|<{$caterow['html']}><{$caterow['cname']}></option>
								</volist>
						</select>
					</td>
				</tr>
				<tr>
					<td>所在地区</td>
					<td>
						<select name="lid" id="">
								<option value="0">请选择地区</option>
								<volist name='localrows' id='localrow'>
									<option value="<{$localrow['lid']}>">|<{$localrow['html']}><{$localrow['lname']}></option>
								</volist>
						</select>
					</td>
				</tr>
			<tr>
				<td>商品主标题</td>
				<td>
					<input type="text" name="main_title" datatype="*1-35" errormsg="长度1-35位任意字符"  nullmsg="商品主标题不能为空" sucmsg="填写正确"/>
					<span class="Validform_checktip" >不能超过35个字</span>
				</td>
			</tr>
			<tr>
				<td>商品副标题</td>
				<td>
					<input type="text" name="sub_title" datatype="*1-100" errormsg="长度1-100位任意字符"  nullmsg="商品副标题不能为空" sucmsg="填写正确"/>
					<span class="Validform_checktip" >不能超过100个字</span>
				</td>
			</tr>
			<tr>
				<td>商品现价</td>
				<td>
					<input type="text" name="price" datatype="n" errormsg="必须为数字"  nullmsg="价格不能为空" sucmsg="填写正确"/>
				</td>
			</tr>
			<tr>
				<td>商品原价</td>
				<td>
					<input type="text" name="old_price" datatype="n" errormsg="必须为数字" nullmsg="价格不能为空" sucmsg="填写正确"/>
				</td>
			</tr>
			<tr>
				<td>商品图片展示</td>
				<td>
					<input type="file" name="goods_img">
				</td>
			</tr>
			<tr>
				<td>商品服务</td>
				<td>
					<volist name='serverrows' id='serverrow'>
					<input type="checkbox" name="goods_server[]" value="<{$i}>"><{$serverrow}><br/>
					</volist> 
				</td>
			</tr>
			<tr>
				<td>商品细节展示</td>
				<td>
					<!-- 加载编辑器的容器  -->
					<textarea style="width:520px;" name="detail" id="ueditor" >

					</textarea>
				</td>
			</tr>
			<tr>
				<td></td>
				<td><input type="submit" class='btn btn-primary' /></td>
			</tr>

		</tbody>
	</table>
	</form>
</div>
<!-- Ueditor配置 开始-->
<!-- 配置文件 -->
<script type="text/javascript" src="__ROOT__/Public/Ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__ROOT__/Public/Ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
      window.UEDITOR_HOME_URL ="__ROOT__/Public/Ueditor/";//指出ueditor的存放路径
      window.onload=function(){
          UE.getEditor('ueditor');//要传入一个ID才能显示编辑器，即textarea中的id
      }
</script>
<!-- Ueditor配置 结束-->
</block>